package com.lims.dao.common.impl;

import java.util.List;


import com.lims.dao.base.BaseDAOImpl;
import com.lims.dao.common.IProjectDAO;
import com.lims.po.common.Project;

public class ProjectDAOImpl extends BaseDAOImpl<Project> implements IProjectDAO {
	private static final String className=ProjectDAOImpl.class.toString();
	public List<Project> selectAll(){
		String hql="from Project order by pid";
		return super.ExecuteQuery(hql, className+"-->selectAll()");
	}
	public boolean saveProject(Project project){
		return super.saveObject(project, className+"-->saveProject(Project Project)")>0?true:false;
	}
	public boolean updateProject(Project project){
		return super.updateObject(project, className+"-->updateProject(Project Project)");
	}
	public boolean deleteProject(Project project){
		return super.deleteObject(project, className+"-->deleteProject(Project Project)");
	}
	public boolean selectProjectByProjectTitle(String ProjectTitle){
		String hql="from Project where ProjectName='"+ProjectTitle+"'";
		return super.ExecuteQuery(hql, className+"-->selectProjectByProjectName(String ProjectName)").size()==0?false:true;
	}
	public boolean deleteProjectById(int pid){
		String hql="delete from Project where pid="+pid;
		return super.ExecuteNonQuery(hql, className+"-->deleteProjectById(int pid)");
	}
	
	public Project selectProjectById(int pid) {
		return super.selectById(pid, className+"-->selectProjectById(int pid)");
	}
}
